package com.wxapp.common.constant.properties;

import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author lgl
 * @Description 普通缓存常用类
 * @Datetime 2023/7/12 14:49
 * @Modified By
 */
@Component
@Getter
public class CatchCommonProperties {
    private final static String replaceStr="wxapp-";
    private final static String splitStr=":";
    // 注解缓存
    public static String COMMON_CATCH = "";
    public static String name;
    public static String value;

    @Value("${spring.application.name}")
    public void setName(String name) {
        this.name = name.replace(replaceStr, "").toUpperCase() ;
        this.COMMON_CATCH = this.COMMON_CATCH + this.name+ splitStr;
    }

    @Value("${spring.profiles.active}")
    public void setValue(String value) {
        this.value = value.toUpperCase();
        this.COMMON_CATCH = this.COMMON_CATCH + this.value+ splitStr;
    }
}
